window.onload = changeMenu;

	function changeMenu(id) {
		var d = document.getElementById(id);
		//aumente i de acordo com sua necessidade 
		for ( var i = 1; i <= 20; i++)
			//aumente j de acordo com sua necessidade	
			for ( var j = 1; j <= 60; j++) {
				if (document.getElementById('ssmenu' + j)) {
					document.getElementById('ssmenu' + j).style.display = 'none';
				}
				if (document.getElementById('smenu' + i + '' + j)) {
					document.getElementById('smenu' + i + '' + j).style.display = 'none';
				}
			}

		for ( var j = 1; j <= 100; j++) {
			if (document.getElementById('smenu' + id + '' + j))
				document.getElementById('smenu' + id + '' + j).style.display = 'block';
		}

	}

	//david
	function changeSubMenu(id) {
		var d = document.getElementById(id);
		for ( var i = 1; i <= 100; i++) {
			if (document.getElementById('ssmenu' + i)) {
				document.getElementById('ssmenu' + i).style.display = 'none';
			}
		}
		if (d) {
			d.style.display = 'block';
		}
	}